/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 刘国水
 * Date: 2025-04-15
 * Time: 22:27
 */
public class test {

    public static void main3(String[] args) {
        MyArray myArray = new MyArray();
        myArray.add(0,11);
        myArray.add(1,22);
        myArray.add(2,33);
        myArray.add(3,44);
        int rte = myArray.indexOf(5);
        System.out.println(rte);
    }
    public static void main(String[] args) {
        try {
            MyArray myArray = new MyArray();
            myArray.add(0,11);
            myArray.add(1,22);
            myArray.add(2,33);
            myArray.add(3,44);
            myArray.remove(22);
            myArray.display();
        } catch (EmptyListException e) {
            e.printStackTrace();
        } catch (PosListException e) {
            e.printStackTrace();
        }



//        System.out.println("================");
//        myArray.add(1,100);
//        myArray.display();
    }
    public static void main1(String[] args) {
        MyArray myArray = new MyArray();
        myArray.add(1);
        myArray.add(2);
        myArray.add(3);
        myArray.display();
    }
}
